package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.Rule;
import edu.pku.sei.transformation.editor.model.RuleInvoke;

public class RuleInvokeCreateCommand extends
		AbstractLinkCreateCommand<RuleInvoke, Rule, Rule> {
	public RuleInvokeCreateCommand(RuleInvoke invoke, Rule source) {
		super(invoke, source);
	}

	@Override
	public void execute() {
		link.setCaller(this.source);
		link.setCallee(this.target);
		this.source.getInvoke().add(link);
	}

	@Override
	public void undo() {
		this.source.getInvoke().remove(link);
	}
}
